$(function () {
    let markId = getUrlString('markid');

    function myCardList (MyCards) {
        let data = {
            'markid':markId,
            'method':MyCards
        };
        getData('post','/niu/apiv4/niu_mycards_recordV2.php',data,function (data) {
            console.log(data);
            if (data.data === null || data.data === ''){
                $('.nodata').show()
            } else {
                $('.nodata').hide();
                let append = '';
                $(data.data).each(function () {
                    let deplete = this.deplete.substr(0,this.deplete.length-1);
                    append += '<li>' +
                        '            <div class="name">'+this.goodsName+'</div>' +
                        '            <div class="consumeCard">消耗卡片：'+deplete+'';
                    append += '</div>' +
                        '            <div class="time">'+this.time+'</div>' +
                        '        </li>'
                });
                $('#recordList').append(append)
            }

        })
    }
    myCardList('Records');
});
